<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src='../js/旧版本/react.development.js'></script>
    <script src='../js/旧版本/react-dom.development.js'></script>
    <script src='../js/旧版本/babel.min.js'></script>
</head>

<body>
    <div id="test"></div>
    <div id="test2"></div>
    <script type='text/babel'>
        class Person extends React.Component {
            render() {
                const { name, sex, age } = this.props
                console.log(this)
                return (
                    <ul>
                        <li>姓名：{name}</li>
                        <li>性别：{sex}</li>
                        <li>年龄：{age + 1}</li>
                    </ul>
                )
            }
        }

        const p = { name: '张三', sex: '男', age: 20 }
        ReactDOM.render(<Person name='阿古拉' sex='男' age={14} />, document.querySelector('#test'))
        ReactDOM.render(<Person {...p} />, document.querySelector('#test2'))
    </script>
</body>

</html>